package cn.iocoder.yudao.module.shop.convert.base;

import cn.iocoder.yudao.module.shop.controller.admin.base.user.UserRespVO;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

@Mapper
public interface UserConvert {

    UserConvert INSTANCE = Mappers.getMapper(UserConvert.class);

    default UserRespVO convertUserDTO(AdminUserRespDTO adminUserRespDTO)
    {
        UserRespVO userRespVO = new UserRespVO();
        userRespVO.setId(adminUserRespDTO.getId());
        userRespVO.setNickname(adminUserRespDTO.getNickname());

        return userRespVO;
    }

    default UserRespVO convertUserDO(AdminUserDO adminUserDO)
    {
        UserRespVO userRespVO = new UserRespVO();
        userRespVO.setId(adminUserDO.getId());
        userRespVO.setNickname(adminUserDO.getNickname());
        userRespVO.setStatus(adminUserDO.getStatus());
        userRespVO.setSortIndex(adminUserDO.getSortIndex());

        return userRespVO;
    }
}
